home *** CD-ROM | disk | FTP | other *** search
- Path: cpsc.ucalgary.ca!davidt
- From: davidt@cpsc.ucalgary.ca (David Taylor)
- Newsgroups: comp.lang.c++
- Subject: Re: G++ math question
- Date: 6 Apr 1996 23:49:24 GMT
- Organization: University of Calgary CPSC
- Message-ID: <4k6vu4$vfh@linux.cpsc.ucalgary.ca>
- References: <00001a81+0000b148@msn.com>
- NNTP-Posting-Host: hk.cpsc.ucalgary.ca
-
- In article <00001a81+0000b148@msn.com>, Roger Marlowe <RMarlowe@msn.com> wrote:
- > I wrote a program on MSVC 4 and I am trying to compile it with G++
- >in a UNIX envir.
- > G++ doesn't know what 'log()', 'pow()' or 'floor()' are even though
- >I have #included<math.h>.
- >
- > Doesn't G++ have math routines or maybe they aren't installed on
- >this particular machine??
-
- Make sure you link with the math library. This is done by putting
- "-lm" at the end of the line. Example:
-
- gcc foo.c -lm
-
- --
- Andrew Taylor |email: davidt@cpsc.ucalgary.ca
- |www: http://www.cpsc.ucalgary.ca/~davidt
-